<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <h3 class="text-center mt-2 editContent">{{ trans('corebg.title') }}</h3>
    <ul class="nav nav-pills">
        <!-- Home -->
        <li class="nav-item">
            <a class="nav-link" href="/">
                <span class="fas fa-home"></span>
            </a>
        </li>
        <!-- Accounts Menu -->
        @if (Session::get('enable_accounts'))
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
                    <span>{{ trans('corebg.accounts') }}</span>
                </a>
                <div class="dropdown-menu">
                    @if (false !== array_search('read-users', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="/users">{{ trans('corebg.accounts.users') }}</a>
                    @endif
                    @if (false !== array_search('read-roles', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.roles') }}</a>
                    @endif
                    @if (false !== array_search('read-permissions', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.permissions') }}</a>
                    @endif
                    @if (false !== array_search('read-people', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.people') }}</a>
                    @endif
                    @if (false !== array_search('read-companies', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.companies') }}</a>
                    @endif
                    @if (false !== array_search('read-addresses', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.addresses') }}</a>
                    @endif
                    @if (false !== array_search('read-telephones', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.telephones') }}</a>
                    @endif
                    @if (false !== array_search('read-emails', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.accounts.emails') }}</a>
                    @endif
                </div>
            </li>
        @endif
        <!-- Geographicals Menu -->
        @if (Session::get('enable_geographicals'))
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
                    <span>{{ trans('corebg.geographicals') }}</span>
                </a>
                <div class="dropdown-menu">
                    @if (false !== array_search('read-countries', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.geographicals.nations') }}</a>
                    @endif
                    @if (false !== array_search('read-regions', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.geographicals.regions') }}</a>
                    @endif
                    @if (false !== array_search('read-districts', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.geographicals.districts') }}</a>
                    @endif
                    @if (false !== array_search('read-cities', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.geographicals.cities') }}</a>
                    @endif
                    @if (false !== array_search('read-zipcodes', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.geographicals.zipcodes') }}</a>
                    @endif
                </div>
            </li>
        @endif
        <!-- Lookpus Menu -->
        @if (Session::get('enable_lookups'))
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
                    <span>{{ trans('corebg.lookups') }}</span>
                </a>
                <div class="dropdown-menu">
                    @if (false !== array_search('read-types', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.lookups.types') }}</a>
                    @endif
                </div>
            </li>
        @endif
        <!-- System Menu -->
        @if (Session::get('enable_system'))
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
                    <span>{{ trans('corebg.system') }}</span>
                </a>
                <div class="dropdown-menu">
                    @if (false !== array_search('read-languages', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.system.languages') }}</a>
                    @endif
                    @if (false !== array_search('read-locales', array_column(Session::get('user_permissions'), 'slug')))
                        <a class="dropdown-item" href="#">{{ trans('corebg.system.locales') }}</a>
                    @endif
                </div>
            </li>
        @endif
        <!-- User Menu -->
        <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
                <span class="fas fa-user"></span>
            </a>
            <div class="dropdown-menu">
                @if (Session::get('user_picture'))
                    <span>
                        <img src="{{ Session::get('user_picture') }}" style="width:100px; height:100px; float:rigth; border-radius:50%; margin-left:25px;">
                    </span>
                    <span>
                        <b style="float:rigth; margin-left:25px;">{{ trans('corebg.user.locale') }}: {{ Session::get('fullLocale')}}</b>
                    </span>
                @endif
                @if (Session::get('user'))
                    <a class="dropdown-item" href="/logout?locale={{ Session::get('fullLocale')}}">{{ trans('corebg.user.logout') }}</a>
                @else
                    <a class="dropdown-item" href="/login">{{ trans('corebg.user.login') }}</a>
                @endif
            </div>
        </li>
    </ul>
</nav>
